﻿<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>登录</title>
<link rel="stylesheet" type="text/css" th:href="@{static/css/styles.css}">
</head>
<body>
<div class="htmleaf-container">
	<div class="wrapper">
		<div class="container">
			<h1>Welcome</h1>
			
			<form class="form">
				<input type="text" id="username" placeholder="Username">
				<input type="password" id="password" placeholder="Password">
				<button type="submit" id="login-button">Login</button>
			</form>
		</div>
		
		<ul class="bg-bubbles">
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
		</ul>
	</div>
</div>

<script th:src="@{/static/js/jquery-2.1.1.min.js}" type="text/javascript"></script>
<script>

$('#login-button').click(function () {
	var user = {
		username: $("#username").val(),
		password: $("#password").val(),
	}
	$.ajax({
		type: "post",
		url: "/login1",
		contentType: 'application/json',
		dataType:"text",
		data: JSON.stringify(user),

		success: function(data) {
			console.log(data);
			window.location.href="/index";
		},
		error: function(xhr) {
			console.log(xhr.status);
		}
	});
	return false;
});


</script>

<div style="text-align:center;margin:50px 0; font:normal 14px/24px 'MicroSoft YaHei';color:#000000">
<h1>数据管理系统</h1>
</div>
</body>
</html>